layui.use(['element','jquery','layer'], function(){
		var $ = layui.jquery;
		var element = layui.element;
		var layer = layui.layer;
		// console.log(layer)
		$(".layui-btn").click(function(){
			// console.log(1421234)
			alert('添加成功！')
			var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
			var sname=$(".sname").val();
			var sphone=$(".sphone").val();
			var saddress=$(".saddress").val();
			
			$.ajax({
			    type: "post",
			    url: "http://localhost:8080/mall/addAddress",
			    dataType: "json",
				data:{
					"name":sname,
					"address":saddress,
					"tel":sphone
				},
			    success: function(data){
					window.location.href = "info.html?value="+sname+"&value2="+saddress+"&value3="+sphone;
					location.reload();
					// console.log(data)
				}
			
			})
			
			parent.layer.close(index);
		})
	})




// function save(){
//         alert('添加成功！')
//         var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
        
// 		var txt=$(".sname").val();
// 		console.log(txt)
// 		parent.layer.close(index);
		
//     }